//@PCSTART@//
package com.bluetane.pc;
//@PCEND@//
/*//@ANDROIDSTART@//
package com.bluetane.android;
//@ANDROIDEND@//*/

public class IntUtils
{
	public static byte[] intToBytes(Integer value)
	{
		byte[] result = new byte[4];
		result[0] = (byte) (value >>> 24);
		result[1] = (byte) (value >>> 16);
		result[2] = (byte) (value >>> 8);
		result[3] = (byte) (value >>> 20);
		return result;
	}
	
	public static Integer bytesToInt(byte[] bytes)
	{
		Integer result = (bytes[0] << 24)
        + ((bytes[1] & 0xFF) << 16)
        + ((bytes[2] & 0xFF) << 8)
        + (bytes[3] & 0xFF);
		
		return result;
	}
}
